import org.molamil.acto.pages.master.Callable;

/**
 * @author Jorge Hernandez
 */
class org.molamil.acto.pages.master.CallerManager implements Callable {
	
	
	//Properties
	
	private var callers:Array; 
	
	
	// Constructor
	
	public function CallerManager() {
		callers = new Array;
	}
	
	
	// Functions
	
	public function addCaller(name:String):Void {
		if (!existsCaller(name))
			callers.push(name);
	}

	public function removeCaller(name:String):Void {
		var a:Array = new Array();
		for (var i:Number = 0; i < callers.length; i++) {
			if (name != callers[i])
				a.push(callers[i]);
		}
		callers = a;
	}
	
	public function existsCaller(name:String):Boolean {
		var b:Boolean = false;
		for (var i : Number = 0; i < callers.length; i++) {
			if (name == callers[i]) {
				b = true;
				break;
			}
		}
		return b;
	}
	
	public function getCallers():Array {
		return callers;
	}
	
	
}
